tools = tools
nasm = $(tools)\nasm
nasm_flag = -fbin -I include/
tasm = $(tools)\tasm
tcc = $(tools)\tcc
tlink = $(tools)\tlink
exe2bin = $(tools)\exe2bin
dd = $(tools)\dd
ima = $(tools)\winimage

.phony: build clean
build: neocs.img

clean:
	mingw32-make --directory=bootsect clean
	mingw32-make --directory=loader clean
	del bootsect.bin /q
	del loader.bin /q
	del neocs.img /q

neocs.img: bootsect.bin loader.bin empty288.img
	copy empty288.img neocs.img
	$(dd) if=bootsect\bootsect.bin of=neocs.img count=1 bs=512
	$(ima) neocs.img /I loader\loader.bin /H /NOASPI

bootsect.bin:
	mingw32-make --directory=bootsect

loader.bin:
	mingw32-make --directory=loader
